#include "ShareMemory.hpp"
#include "time.hpp"
#include"PipeName.hpp"
using namespace std;
int main()
{
   shm.CreatShm();
   shm.AttachShm();
   ff1.OpenPipeForWrite();
   ff2.OpenPipeForRead();
   // 进行通信
   data *da = (data *)shm.GetAddr();
   while (true)
   {
      strcpy(da->status, "newest");
      strcpy(da->lasttime, GetTime().c_str());
      strcpy(da->messsage, "010100101010");
      sleep(3);
      ff1.Write();
      ff2.Read();
      sleep(2);
      //  char*strinfo=(char*)shm.GetAddr();
      //  char ch='A';
      //  while(ch<'Z'){
      //    strinfo[ch-'A']=ch++;
      //    sleep(1);
   }
   shm.DetachShm();
   shm.deleteShm();
   return 0;
}
